From Jeremy. Allow encrypting hints & update README.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 10 Jan 2005 01:54:37 +0000 (01:54 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 10 Jan 2005 01:54:37 +0000 (01:54 +0000)
gpsbabel/README
gpsbabel/vcf.c

index fb6bf589428f6d4583eae5d1981964419d6c003d..4adeaecb17d68af24a661c506f81d1f6d5b76e07 100644 (file)
@@ -647,7 +647,21 @@ THE FORMATS
 
         HSA Systems Endeavour Navigator format - will import both the old
         version 4.x binary files, and the newer XML based ones. 
-        Only writes the new XML (5.0 and above) format. (use the .exp extension)
+        Only writes the new XML (5.0 and above) format. (use the .exp 
+       extension)
+
+    vCARD
+
+        The vCard output is intended to be in a format that enables
+        waypoints to be viewed with an Apple iPod. This is achieved by
+        mapping waypoint fields into vCard fields that can be displayed
+        as 'Contacts' on the iPod. With the iPod mounted as a hard disk
+        (see your iPod manual for instructions), the resulting VCF
+        file should be moved into the iPod 'Contacts' folder. As an
+        alternative, Mac OS X users may prefer to drag the VCF file into
+        their address book and synchronize with the iPod using iSync. By
+       default hints are unencrypted; use the 'encrypt' option to
+        encrypt the hints.
 
 DATA FILTERS
 
index 76002c986ecaebcda3c69691fb8a310cecf61c02..8c1ad9a413770045cf9c5bc1092d13ffce879466 100644 (file)
 static FILE *file_out;
 static void *mkshort_handle;
 
+static char *encrypt = NULL;
+
 #define MYNAME "VCF"
 
 static
 arglist_t vcf_args[] = {
+       { "encrypt", &encrypt,
+               "Encrypt hints using ROT13", NULL, ARGTYPE_BOOL },
        {0, 0, 0, 0, 0}
 };
 
@@ -72,8 +76,10 @@ static void
 vcf_print(const char *s)
 {
        char *p;
+
        if (!s)
                return;
+
        p = gstrsub(s, "\n", "\\n");
        fputs(p, file_out);
        xfree(p);
@@ -105,7 +111,13 @@ vcf_disp(const waypoint *wpt)
        fprintf(file_out, "\\n");
        vcf_print_utf(&wpt->gc_data.desc_long);
        fprintf(file_out, "\\n\\nHINT:\\n");
-       vcf_print(wpt->gc_data.hint);
+       if (encrypt) {
+               char *s = rot13(wpt->gc_data.hint);
+               vcf_print(s);
+               xfree(s);
+       } else {
+               vcf_print(wpt->gc_data.hint);
+       }
 
        fprintf(file_out, "\nEND:VCARD\n");
 }